import react, { Fragment } from "react";
import propTypes from "prop-types"
class InputTest extends react.Component{
    render(){
        return(
            <Fragment>
                <label htmlFor="labelText">输入</label>
                <input id="labelText" type="text" value={this.props.inpVal} onChange={this.handleInpChange.bind(this)} />
                <input type="button" value="提交" onClick={this.handleSubmit.bind(this)} />
            </Fragment>
        )
    }
    // shouldComponentUpdate(nextProps,nextState){
    //     console.log(nextProps)
    //     console.log(nextState)
    //     return true
    // }
    handleInpChange(e){
        this.props.handleInpChange(e)
    }
    handleSubmit(){
        this.props.handleSubmit()
    }
}
export default InputTest
InputTest.propTypes={
    inpVal:propTypes.func
    // inpVal:PropTypes.oneOf([PropTypes.string,PropTypes.number])
}